﻿namespace MBA.FluentExt
{
	public class AnchorUnit
	{
		#region Fields

		protected readonly string value;

		#endregion Fields

		#region Constructors

		protected AnchorUnit(string value)
		{
			this.value = value;
		}

		#endregion Constructors

		#region Properties

		public static AnchorUnit Auto
		{
			get { return new AnchorUnit("auto"); }
		}

		public static AnchorUnit Bottom
		{
			get { return new AnchorUnit("b"); }
		}

		public static AnchorUnit Right
		{
			get { return new AnchorUnit("r"); }
		}

		#endregion Properties

		#region Methods

		public static AnchorUnit Offset(int offsetValue)
		{
			return new AnchorUnit(offsetValue.ToString());
		}

		public static AnchorUnit Percent(uint percentValue)
		{
			return new AnchorUnit("{0}%".FormatWith(percentValue));
		}

		public override string ToString()
		{
			return value;
		}

		#endregion Methods
	}
}